<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: zhuzonghui
  Date: 2022/4/20
  Time: 下午10:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户管理</title>
</head>
<body>
<div>
    <center>
        <div>
            <div><h2>${title}</h2></div>
            <div>
                <div>
                    <button>添加用户</button>
                </div>
                <div style="display: none" id="addUserDiv">
                    <div>
                        <table border="1">
                            <tr>
                                <th>添加用户</th>
                            </tr>
                            <tr>
                                <th>
                                    <table>
                                        <tr>
                                            <th></th>
                                        </tr>
                                    </table>
                                </th>
                            </tr>
                        </table>
                    </div>
                </div>
                <div>
                    <table>
                        <tr>
                            <c:if test="${tUser.userPermssionId==1}">
                                <th>
                                    <button>设为学校管理员</button>
                                </th>
                            </c:if>
                            <c:if test="${tUser.userPermssionId<=2}">
                                <th>
                                    <button>设为学院管理员</button>
                                </th>
                            </c:if>
                            <c:if test="${tUser.userPermssionId<=3}">
                                <th>
                                    <button>设为班级管理员</button>
                                </th>
                            </c:if>
                            <th>
                                <button>删除用户</button>
                            </th>
                            <th>
                                <button>修改密码</button>
                            </th>
                        </tr>
                    </table>
                </div>
                <div>
                    <table border="1">
                        <tr>
                            <th>选择</th>
                            <th>用户id</th>
                            <th>账号</th>
                            <th>用户名</th>
                            <th>是否启用</th>
                            <th>最近一次登陆时间</th>
                            <th>学校名称</th>
                            <th>院系名称</th>
                            <th>班级名称</th>
                            <th>权限</th>
                        </tr>
                        <c:forEach items="${tUserList}" var="tUser">
                            <tr>
                                <th>
                                    <div><input type="checkbox" name="userId" value="${tUser.userId}"></div>
                                </th>
                                <th>${tUser.userId}</th>
                                <th>${tUser.stuNumber}</th>
                                <th>${tUser.usernick}</th>
                                <th>
                                    <c:if test="${tUser.isDelete==2}">
                                        启用
                                    </c:if>
                                    <c:if test="${tUser.isDelete!=2}">
                                        未启用
                                    </c:if>
                                </th>
                                <th><fmt:formatDate value="${tUser.lastLoginTime}"
                                                    pattern="yyyy-MM-dd"></fmt:formatDate></th>
                                <th>${tUser.schoolName}</th>
                                <th>${tUser.collageName}</th>
                                <th>${tUser.className}</th>
                                <th>${tUser.userPermssionName}</th>
                            </tr>
                        </c:forEach>
                    </table>
                </div>
            </div>
        </div>
    </center>
</div>
</body>
</html>
